package com.hongyun.tms.common.dto.mship;

import com.alibaba.excel.annotation.ExcelProperty;
import com.hongyun.tms.common.annotation.excel.ExcelInfo;
import com.hongyun.tms.infra.excel.converter.dict.DictConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 船舶导出模板 响应
 *
 * @author liPeng
 * @date 2024-05-31
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ExcelInfo(fileName = "船舶模板")
public class MShipTemplateDto implements Serializable {

    @ApiModelProperty(value = "船名")
    @NotBlank(message = "船名不能为空")
    @Size(message = "船名不能超过30个字符", max = 30)
    @ExcelProperty(value = "船名(必填)", index = 0)
    private String shipName;

    @ApiModelProperty(value = "船舶类型代码，字典")
    @NotBlank(message = "船舶类型代码不能为空")
    @Size(message = "船舶类型代码不能超过20个字符", max = 20)
    @ExcelProperty(value = "船舶类型(必填;客船/油船/散货船等 任填一项即可)", converter = DictConverter.class, index = 1)
    private String shipKindCode;


    @ApiModelProperty(value = "船长")
    @NotNull(message = "船长不能为空")
    @DecimalMax(value = "999", message = "船长不能超过999米")
    @DecimalMin(value = "1", message = "船长不能小于1米")
    @ExcelProperty(value = "船长(必填)", index = 2)
    private BigDecimal shipLength;

    @ApiModelProperty(value = "船宽")
    @NotNull(message = "船宽不能为空")
    @DecimalMax(value = "999", message = "船长不能超过999米")
    @DecimalMin(value = "1", message = "船长不能小于1米")
    @ExcelProperty(value = "船宽", index = 3)
    private BigDecimal shipWidth;

    @ApiModelProperty(value = "总吨")
    @NotNull(message = "总吨数不能为空")
    @DecimalMin(value = "0", message = "总吨数不能小于0")
    @DecimalMax(value = "99999.99", message = "总吨数不能大于99999.99")
    @ExcelProperty(value = "总吨(必填)", index = 4)
    private BigDecimal totalTon;

    @ApiModelProperty(value = "净吨")
    @NotNull(message = "净吨数不能为空")
    @DecimalMin(value = "0", message = "净吨数不能小于0")
    @DecimalMax(value = "99999.99", message = "净吨数不能大于99999.99")
    @ExcelProperty(value = "净吨(必填)", index = 5)
    private BigDecimal netTon;

    @ApiModelProperty(value = "载重吨")
    @NotNull(message = "载重吨不能为空")
    @DecimalMin(value = "0", message = "载重吨数不能小于0")
    @DecimalMax(value = "99999.99", message = "载重吨数不能大于99999.99")
    @ExcelProperty(value = "载重吨(必填)", index = 6)
    private BigDecimal dwt;

    @ApiModelProperty(value = "船上电话")
    @Size(max = 20, message = "船上电话不能超过20个字符")
    @ExcelProperty(value = "船上电话", index = 7)
    private String shipPhone;
}

